#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDockWidget>
#include <QLabel>
#include <QPushButton>
#include <QVBoxLayout>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    QDockWidget* dockWidget = new QDockWidget();
    this->addDockWidget(Qt::LeftDockWidgetArea, dockWidget);
    QWidget* container = new QWidget();
    dockWidget->setWidget(container);

    QVBoxLayout* layout = new QVBoxLayout;
    container->setLayout(layout);

    QLabel* label = new QLabel("这是一个QLabel");
    QPushButton* button = new QPushButton("这是按钮");
    layout->addWidget(label);
    layout->addWidget(button);

    dockWidget->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::TopDockWidgetArea);



}

MainWindow::~MainWindow()
{
    delete ui;
}

